package models;
import java.util.*;

import javax.persistence.*;

import play.data.validation.Required;
import play.db.jpa.*;
 
@Entity
public class Participe extends Model
{
	@Required
	@ManyToOne
    public Course course;
	
	@Required
	@ManyToOne
    public Bateau bateau;
	
	public int temps_total;
	public int classement;
	
	public Date date_inscription;
		
	
	public Participe(Course course, Bateau bateau) 
	{
		this.course = course;
		this.bateau = bateau;
	}


	public Participe(Course course, Bateau bateau, int temp_total,
			int classement, Date date_inscription) 
	{
		this.course = course;
		this.bateau = bateau;
		this.temps_total = temp_total;
		this.classement = classement;
		this.date_inscription = date_inscription;
	}
	
	public String toString()
	{
		return this.course.titre_course + "[" + this.course.id + "] " + this.bateau.nom; 
	}
	
}
